<template>
    <div class="son">
        <h1>Son2,,,测试传值：子到父</h1>
        <p>count的值：{{count}}</p>
        <button @click="add">+1</button>
    </div>
</template>

<script>

    export default {
        name: "Son2",
        data(){
            return{
                count:10
            }
        },
        methods:{
            add(){
                this.count++;
                this.$emit("change",this.count)
            }
        }
    }
</script>

<style scoped>

</style>